<!doctype html>
<html ng-app="myApp">
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
    <script src="script.js"></script>
</head>
<body>

<div ng-controller="GreetingCtrl">
    <input type="text" ng-model="greeting">
</div>

<div ng-controller="DoubleCtrl">
    <input ng-model="num"> 翻倍后等于 {{double(num)}}
</div>

</body>
<script type="text/javascript">
    var myApp = angular.module('myApp',[]);

    myApp.controller('GreetingCtrl', ['$scope', function($scope) {
        $scope.greeting = 'Hola!';
    }]);

    myApp.controller('DoubleCtrl', ['$scope', function($scope) {
        $scope.double = function(value) {
            return value * 2;
        };
    }]);
</script>
</html>
